#include <string>

#define PRINT_BINARY(num)                                                                                                                                                          \
	do {                                                                                                                                                                           \
		for (int i = 15; i >= 0; i--) {                                                                                                                                            \
			if (i == 7) {                                                                                                                                                          \
				printf(" ");                                                                                                                                                       \
			}                                                                                                                                                                      \
			printf("%d", (num >> i) & 1);                                                                                                                                          \
		}                                                                                                                                                                          \
		printf("\n");                                                                                                                                                              \
	} while (0)


#if 0	
// 编译：g++ -std=c++11 -Wall -Wextra -Werror -o bits.exe bits.cpp
int main() {
	int a = 0b11001100;
	int b = 0b00110011;
	int c = a ^ b;
	int d = a & b;
	int e = a | b;
	int f = ~a;
	int g = a << 2;
	int h = a >> 2;

	printf("a = ");
	PRINT_BINARY(a);
	printf("b = ");
	PRINT_BINARY(b);
	printf("c = a ^ b = ");
	PRINT_BINARY(c);
	printf("d = a & b = ");
	PRINT_BINARY(d);
	printf("e = a | b = ");
	PRINT_BINARY(e);
	printf("f = ~a = ");
	PRINT_BINARY(f);
	printf("g = a << 2 = ");
	PRINT_BINARY(g);
	printf("h = a >> 2 = ");
	PRINT_BINARY(h);
	return 0;
}
#endif
